package com.hcbd.tdwt.ui.xingyu.activity;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Build;
import android.util.Log;


import com.hcbd.tdwt.R;
import com.hcbd.tdwt.base.BaseActivity;
import com.hcbd.tdwt.base.Constant;
import com.hcbd.tdwt.base.bd.BdToolFactory;
import com.hcbd.tdwt.base.bd.XYSerialPortManage;
import com.hcbd.tdwt.util.PropUtils;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;

@SuppressLint("NonConstantResourceId")
@EActivity(R.layout.activity_splash)
public class SplashActivity extends BaseActivity {
    String TAG = "SplashActivity";
    @AfterViews
    protected void init() {
     /*   if(XYSerialPortManage.getInstance().pdaCheck()){
            BdToolFactory.newInstance(BdToolFactory.XY_PDA_BG_TYPE);
        }else{
            BdToolFactory.newInstance(BdToolFactory.XY_BG_TYPE);
        }*/
        // 判断手持机类型
        String identify = PropUtils.getProp( "ro.board.platform",  "");
        Constant.XY_HANDSET = identify.equals("mt6853")? Constant.P31:Constant.P3;
        // BdToolFactory.newInstance(BdToolFactory.XY_BG_TYPE);
        BdToolFactory.newInstance(BdToolFactory.XY_PDA_BG_TYPE);
        Log.e(TAG, "init: "+identify);
        Thread mThread=new Thread(){
            @Override
            public void run() {
                super.run();
                try {
                    sleep(3000);//使程序休眠3秒
                    Intent intent=new Intent(getApplicationContext(),MainActivity_.class);
                    startActivity(intent);
                    finish();
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        };
        mThread.start();
    }
}
